package com.liveinstars.api.im;


import com.liveinstars.api.im.vo.ChatGroupDto;
import com.liveinstars.api.im.vo.ChatGroupRecordVO;
import com.liveinstars.api.im.vo.NoticeMessageVO;
import com.liveinstars.api.im.vo.NoticeVO;
import com.onepiece.shipelves.common.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("im")
public interface ChatGroupApiService {

	@GetMapping("/chatGroup/createChatGroup")
	Result<ChatGroupRecordVO> createChatGroup(@RequestParam(value = "name", defaultValue = "") String name,
                                                     @RequestParam(value = "userId", defaultValue = "") Long userId,
                                                     @RequestParam(value = "users", defaultValue = "") String users,
                                                     @RequestParam(value = "desc", defaultValue = "") String desc,
                                                     @RequestParam(value = "type", defaultValue = "6") Integer type,
                                                     @RequestParam(value = "user_level", defaultValue = "0") Integer user_level,
                                                     @RequestParam(value = "logo", defaultValue = "") String logo,
                                                     @RequestParam(value = "interest_id", defaultValue = "") Integer interestId);



	@GetMapping("/chatGroup/updateChatGroup")
	Result<ChatGroupRecordVO> updateChatGroup(@RequestParam(value = "chatGroupId", defaultValue = "") Long chatGroupId,
						   @RequestParam(value = "name", defaultValue = "") String name,
						   @RequestParam(value = "userId", defaultValue = "") Long userId,
						   @RequestParam(value = "desc", defaultValue = "") String desc,
						   @RequestParam(value = "logo", defaultValue = "") String logo,
						   @RequestParam(value = "user_level", defaultValue = "") Integer user_level,
						   @RequestParam(value = "authRule", defaultValue = "") Integer authRule
						   );

	@GetMapping("/chatGroup/getNewNotice")
	Result<NoticeVO> getNotice(@RequestParam(value = "chat_group_id", defaultValue = "") Long chatGroupId);

	@GetMapping("/chatGroup/shieldChatGroup")
	String shieldChatGroup(
			@RequestParam(value = "chatGroupId", defaultValue = "") Long chatGroupId,
			@RequestParam(value = "userId", defaultValue = "") Long userId,
			@RequestParam(value = "shieldUserId", defaultValue = "") Long shieldUserId,
			@RequestParam(value = "shieldTime", defaultValue = "0") Integer shieldTime);

	@GetMapping("/chatGroup/noDisturbChatGroup")
	String noDisturbChatGroup(@RequestParam(value = "chatGroupId", defaultValue = "") Long chatGroupId,
						   @RequestParam(value = "userId", defaultValue = "") Long userId
	);

	@GetMapping("/chatGroup/getChatGroup")
	String getChatGroup(@RequestParam(value = "chatGroupId", defaultValue = "") Long chatGroupId,
						@RequestParam(value = "userId", defaultValue = "") Long userId);


	@GetMapping("/chatGroup/getChatGroupList")
	String getChatGroupList(@RequestParam(value = "userId", defaultValue = "") Long userId,
						@RequestParam(value = "groupType", defaultValue = "") Integer groupType,
						@RequestParam(value = "groupPage", defaultValue = "") Integer groupPage,
						@RequestParam(value = "groupCount", defaultValue = "") Integer groupCount);

	@GetMapping("/chatGroup/getHotChatGroupList")
	String listHotChatGroup(@RequestParam(value = "userId", defaultValue = "") Long userId);

	@GetMapping("/chatGroup/getChatGroupByCreateUid")
	String getChatGroupByCreateUid(@RequestParam(value = "userId", defaultValue = "") Long userId);

	@GetMapping("/chatGroup/getChatGroupByUid")
	String getChatGroupByUid(@RequestParam(value = "userId", defaultValue = "") Long userId);

	@GetMapping("/chatGroup/getChatGroupListByUid")
	List<ChatGroupDto> getChatGroupListByUid(@RequestParam(value = "userId", defaultValue = "") Long userId);

	@GetMapping("/chatGroup/leaveChatGroup")
	String leaveChatGroup(@RequestParam(value = "chatGroupId", defaultValue = "") Long chatGroupId,
						  @RequestParam(value = "userId", defaultValue = "") Long userId
						  );

	@GetMapping("/chatGroup/dissolveChatGroup")
	String dissolveChatGroup(@RequestParam(value = "chatGroupId", defaultValue = "") Long chatGroupId,
						  @RequestParam(value = "userId", defaultValue = "") Long userId
						  );

	@GetMapping("/chatGroup/kickOutChatGroup")
	String kickOutChatGroup(@RequestParam(value = "chatGroupId", defaultValue = "") Long chatGroupId,
							@RequestParam(value = "userId", defaultValue = "") Long userId,
							@RequestParam(value = "kickWho", defaultValue = "") String kickWho);

	@GetMapping("/chatGroup/getChatGroupMember")
	String getChatGroupMember(@RequestParam(value = "chatGroupId", defaultValue = "") Long chatGroupId,
							  @RequestParam(value = "userId", defaultValue = "") Long userId
							  );

	@GetMapping("/chatGroup/joinChatGroup")
	String joinChatGroup(@RequestParam(value = "chatGroupId", defaultValue = "") Long chatGroupId,
						 @RequestParam(value = "userId", defaultValue = "") Long userId,
						 @RequestParam(value = "reqMsg", defaultValue = "") String reqMsg);

	@GetMapping("/chatGroup/isHasGroupCreate")
	Result<Boolean> isHasGroupCreate(@RequestParam(value = "userId", defaultValue = "") Long userId);

	@GetMapping("/chatGroup/makeFriend")
	Boolean makeFriend(@RequestParam(value = "friendId", defaultValue = "") Long friendId,
					   @RequestParam(value = "userId", defaultValue = "")  Long userId);

	@GetMapping("/chatGroup/isFriend")
	Boolean isFriend(@RequestParam(value = "userId", defaultValue = "") Long userId,
							 @RequestParam(value = "myId", defaultValue = "") Long myId);

	/**
	 * 用于外部调用发送消息给用户
	 * @param messageVO
	 * @return
	 */
	@PostMapping("/chatGroup/sendMessage")
	Boolean sendMessage(@RequestBody NoticeMessageVO messageVO);
}
